package cn.zysheep.singleton.demo5;

/**
 * @ClassName: Singleton
 * @Description: 静态内部类  单例模式
 * @Author: lyw
 * @Date: 2022/10/17 22:01
 */
public class Singleton {
    private Singleton(){};

    private static class SingletonHolder {
        private static final Singleton SINGLETON = new Singleton();
    }

    public Singleton getInstance() {
        return SingletonHolder.SINGLETON;
    }
}
